version: '3'
services:
  flectra:
    build:
      context: ./flectra
    depends_on:
      - db
    environment:
      - WDB_SOCKET_SERVER=wdb
      - WDB_NO_BROWSER_AUTO_OPEN=True
    ports:
      - "7073:7073"
    volumes:
      - flectra-web-data:/var/lib/flectra
      - ./src/flectra:/opt/flectra:rw,z
      - ./etc:/etc/flectra:ro,z
      - ./src/repos:/mnt/repos:rw,z
  db:
    image: postgres:9.6-alpine
    ports:
      - "5050:5432"
    environment:
      - POSTGRES_PASSWORD=flectra
      - POSTGRES_USER=flectra
      - PGDATA=/var/lib/postgresql/data/pgdata
    volumes:
      - flectra-db-data:/var/lib/postgresql/data/pgdata
  wdb:
    image: kozea/wdb-server
    ports:
      - "1984:1984"
volumes:
  flectra-web-data:
  flectra-db-data:
